package com.codes.model;

import io.swagger.annotations.ApiModelProperty;

import javax.validation.constraints.Size;

public class User {

    @ApiModelProperty(value="ID",name="id",example="1") // int类型 不写example  会报类型转换异常
    private Integer id;
    @Size(min = 1,max = 20,message = "名字的长度必须为1到20")
    @ApiModelProperty(value="用户名字",example="小明")
    private String userName;
    @ApiModelProperty(value="手机号",example="18312341234")
    private String phone;
    @Size(min = 1,max = 20,message = "名字的长度必须为1到20")
    @ApiModelProperty(value="账号",example="account")
    private String account;
    @Size(min = 1,max = 20,message = "密码的长度必须为1到20")
    private String password;

    private String token;

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName == null ? null : userName.trim();
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone == null ? null : phone.trim();
    }

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account == null ? null : account.trim();
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password == null ? null : password.trim();
    }
}